package java9_2;

import java.util.InputMismatchException;

/**
 * @author oldliu
 * @since 1.0
 */
public class Calc {
    public int div2(int a,int b)throws Exception{

        int c = a / b;
        return c;
    }
    public int div1(int a,int b)throws InputMismatchException, ArithmeticException{

            int c = a / b;
            return c;
    }

    public int divide(int a,int b)throws InputMismatchException, Exception{
        try {
            int c = a / b;
            return c;
        }catch (Exception e){
            System.out.println("处零错误");
            e.printStackTrace();
            throw e;
            //throw new Exception("数学错误："+e);
        }

    }
    public int divide2(int a,int b)throws Exception{
        try {
            int c = a / b;
            return c;
        }catch (Exception e){
            System.out.println("处零错误");
            e.printStackTrace();
        }
        return 0;
    }
    public int divide1(int a,int b)throws Exception{
        try {
            int c = a / b;
            return c;
        }catch (Exception e){
            System.out.println("处零错误");
            e.printStackTrace();
        }
        return 0;
    }
}
